﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="logger-test.aspx.cs" Inherits="Dala.Samples.LoggerTest.logger_test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Logging Test</title>
    <%# JSNLog.JavascriptLogging.Configure() %>
    <script type="text/javascript">
        window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
            // Send object with all data to server side log, using severity fatal, 
            // from logger "onerrorLogger"
            JL("onerrorLogger").fatalException({
                "msg": "Exception!",
                "errorMsg": errorMsg,
                "url": url,
                "line number": lineNumber,
                "column": column
            }, errorObj);
            // Tell browser to run its own error handler as well
            return false;
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <h1>Test Logging using log4net and JSNLog from c# backend and javascript</h1>
    <script type="text/javascript">
        JL("Page Logger").info("Info logging from client side");
        JL("Page Logger").debug("Debug logging from client side");
        JL("Page Logger").error("Error logging from client side");
        JL("Page Logger").fatal("Fatal logging from client side");
        alert(undefinedVariable);
    </script>
    </form>
</body>
</html>
